home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_11_01
/
1101069a
< prev
next >
Wrap
Text File
|
1992-11-01
|
597b
|
26 lines
static boolean
fgsend_control (ixxx, iyyy)
int ixxx;
int iyyy;
{
char ab[CFRAMELEN];
int ictl;
unsigned short icheck;
ab[IFRAME_DLE] = DLE;
ab[IFRAME_K] = KCONTROL;
ictl = (CONTROL << 6) | (ixxx << 3) | iyyy;
icheck = (unsigned short) (0xaaaa - ictl);
ab[IFRAME_CHECKLOW] = (char) (icheck & 0xff);
ab[IFRAME_CHECKHIGH] = (char) (icheck >> 8);
ab[IFRAME_CONTROL] = (char) ictl;
ab[IFRAME_XOR] = (char) (ab[IFRAME_K] ^ ab[IFRAME_CHECKLOW]
^ ab[IFRAME_CHECKHIGH] ^ ab[IFRAME_CONTROL]);
return fsend_data (ab, CFRAMELEN, TRUE);
}